package com.js.domian.model.bot.analysis.message;

import cn.hutool.json.JSONUtil;
import com.js.domian.model.bot.analysis.Message;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class RecordMessage implements Message {

    private String file;

    private String url;

    public RecordMessage(String file) {
        this.file = file;
    }

    @Override
    public String toString() {
        return "record[" + file + "]";
    }

    @Override
    public String toMessageString() {
        return String.format("{\"type\":\"%s\",\"data\":%s}", "record", JSONUtil.toJsonStr(this));
    }

}
